package com.ygxsk.carhome.ui.adapter;

import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.flyco.roundview.RoundTextView;
import com.ygxsk.carhome.R;
import com.ygxsk.carhome.response.EvaluateListItemBean;
import com.ygxsk.carhome.utils.CommUtils;

import java.util.List;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023-07-17  16:07
 * @Description:评估的历史记录的  条目内容
 */
public class AuthHistoryItemAdapter extends BaseQuickAdapter<EvaluateListItemBean, BaseViewHolder> {
    public AuthHistoryItemAdapter(int layoutResId) {
        super(layoutResId);
    }

    public AuthHistoryItemAdapter(int layoutResId, @Nullable List<EvaluateListItemBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, EvaluateListItemBean evaluateListItemBean) {

        if (evaluateListItemBean != null) {

            //姓名
            String name = evaluateListItemBean.getName();
            //手机号
            String phone = evaluateListItemBean.getPhone();
            //车辆型号
            String carModel = evaluateListItemBean.getCarModel();

            //价格
            String carPrice = evaluateListItemBean.getCarPrice();
            //标签的内容-评估车辆的方式
            String typeEvaluate = evaluateListItemBean.getTypeEvaluate();
            //状态的内容--主要是分配状态
            String satateItem = evaluateListItemBean.getSatateItem();

            //findviews
            //姓名
            //评估的方式标签
            TextView textViewPersonName = (TextView) baseViewHolder.getView(R.id.textviewpersonname);
            //手机号
            TextView textViewEditViewPhone = (TextView) baseViewHolder.getView(R.id.textvieweditviewphone);
            //车辆型号 textviewcarmodelvalue
            TextView textViewCarModelValue = (TextView) baseViewHolder.getView(R.id.textviewcarmodelvalue);
            //评估的价格
            TextView textViewCarPriceValue = (TextView) baseViewHolder.getView(R.id.textviewcarpricevalue);

            //评估的方式标签
            RoundTextView textViewEvaluateFormWhere = (RoundTextView) baseViewHolder.getView(R.id.textviewevaluateformwhere);
            //分配状态
            TextView textViewPersonEvaluateState = (TextView) baseViewHolder.getView(R.id.textviewpersonevaluatestate);

            CommUtils.setText(textViewPersonName, name);
            CommUtils.setText(textViewEditViewPhone, phone);
            CommUtils.setText(textViewCarModelValue, carModel);
            CommUtils.setText(textViewCarPriceValue, carPrice);

            //评估的状态
            CommUtils.setText(textViewEvaluateFormWhere, typeEvaluate);
            CommUtils.setText(textViewPersonEvaluateState, satateItem);

        }

    }
}
